import React, { memo } from 'react';
import { HashRouter } from 'react-router-dom';
import { renderRoutes } from 'react-router-config';
// 可以看到react-redux通常就是做一些连接react和store的事情
import { Provider } from 'react-redux';
import routes from '@/router';
import store from '@/store';
import MusicAppHeader from '@/components/app-header';
import MusicAppFooter from '@/components/app-footer';
import MusicAppPlayerBar from '@/pages/player/app-player-bar';

export default memo(function App() {
  return (
    // 通过该标签包裹将store传入
    <Provider store={store}>
      <HashRouter>
        <MusicAppHeader />
        {renderRoutes(routes)}
        <MusicAppFooter />
        <MusicAppPlayerBar />
      </HashRouter>
    </Provider>
  )
});

